const { promisify } = require('util')

module.exports.clone = async function(repo, desc) {
  const download = promisify(require('download-git-repo'))
  console.log(`🚗开始下载...${repo}`)

  // 下载进度条 (坑)
  // const ora = require('ora')
  // `🚗开始下载...${repo}`
  // '🚚下载中...'
  // const spinner = ora(`🚗开始下载...${repo}`).start()
  // spinner.color = 'blue',
  // spinner.text = '🚚下载中...'


  // 开始下载
  await download(repo, desc, {clone: true})
  // 结束进度条
  // spinner.succeed('下载完毕🆗')
  console.log('下载完毕🆗')
}